package canss.webservice.test;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import canss.webservice.service.PortalIntraWebServiceControl;
import canss.webservice.service.PortalIntraWebServiceControlBean;

public class svtAjaxGetPIDList extends javax.servlet.http.HttpServlet
		implements javax.servlet.Servlet
{
	private static final long serialVersionUID = -7938987025287394513L;
	public svtAjaxGetPIDList()
	{
		super();
	}

	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException
	{
		doPost(request, response);
	}

	PortalIntraWebServiceControl control;
	protected void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException
	{
		response.setContentType("text/html; charset=UTF-8");
		PrintWriter out = response.getWriter();
		
		try
		{
			control = (control == null) ? new PortalIntraWebServiceControlBean() : control;
			String[] pidlist = control.getEntirePID();
			for(String _pid : pidlist)
				out.write(_pid + "_&_");
		}catch(Exception e)
		{
			out.write("error: " + e);
		}
	}
} 